import { reactive } from "vue"

export function useTime() {
  const now = new Date()

  const w = now.getDay()
  const t = 7

  const arr = reactive({
    date: []
  })

  for (let i = 0; i < w; i++) {
    arr.date.push({ date: "" })
  }

  for (let j = 0; j < t; j++) {
    arr.date.push({ date: now.getMonth() + 1 + "/" + now.getDate() }) // 当前的 月份/日期 
    now.setDate(now.getDate() + 1) // 日期的累加，每次累加一天
  }

  return { arr, w, t }
}